//
//  App6UseBlock.m
//  DeyiLife
//
//  Created by zxin on 16/8/1.
//  Copyright © 2016年 Deyi. All rights reserved.
//

#import "ImageTitleBlock.h"

@implementation ImageTitleBlock

- (id)init{
    self = [super init];
    if(self)
    {
        self.backgroundColor = [UIColor whiteColor];
        self.img = [UIImageView new];
        [self addSubview:_img];
        [_img mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.mas_left).with.offset((ScreenWidth/5-40)/2);
            make.top.equalTo(self.mas_top).with.offset(10);
            make.height.mas_equalTo(40);
            make.width.mas_equalTo(40);
        }];
        _img.layer.masksToBounds = YES;
        //_img.layer.cornerRadius = 51.f/2;
        
        self.title = [UILabel new];
        [self addSubview:_title];
        _title.font = [FontTool fontWithSize:10];
        _title.textColor = [UIColor colorWithHexString:@"666666"];
        _title.textAlignment = NSTextAlignmentCenter;
        [_title mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.mas_bottom).with.offset(-8);
            make.left.equalTo(_img.mas_left).with.offset(-5);
            make.right.equalTo(_img.mas_right).with.offset(5);
            make.height.mas_equalTo(15);
        }];
    }
    return self;
}

@end
